package com.hermit.qmst.UI.main;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hermit.qmst.R;
import com.hermit.qmst.UI.activity.PayCardActivity;
import com.hermit.qmst.tools.Common;

public class RechargeFragment extends Fragment implements View.OnClickListener{

    private TextView mtvAccount;
    private RelativeLayout mlySelf;
    private TextView mTitle;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        return inflater.inflate(R.layout.activity_recharge_way,null);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
    }

    private void initView(){
        mtvAccount = (TextView)getActivity().findViewById(R.id.tv_account);
        mtvAccount.setText(Common.myPhone);
        mlySelf = (RelativeLayout)getActivity().findViewById(R.id.rlyt_self);
        mlySelf.setOnClickListener(this);

        mTitle = (TextView)getActivity().findViewById(R.id.tv_title);
        mTitle.setText("充值");
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()){
            case R.id.rlyt_self:

                Intent intent = new Intent();
                intent.setClass(getActivity(),PayCardActivity.class);
                startActivity(intent);
                getActivity().overridePendingTransition(R.anim.fling_in_right2left,R.anim.fling_out_left2right);

                break;
            default:
                break;
        }

    }
}
